from flask import Blueprint, request
from App.models import models,User

blue = Blueprint('blue', __name__)

@blue.route('/')
def index():
    return 'Hello, World'


@blue.route('/sendrequest')
def sendrequest():
    print("参数：")
    print(request.args['a'])

    return 'send success'

@blue.route('/createdb/')
def createdb():
    models.create_all()

    return '创建成功'


@blue.route('/createuser/')
def createuser():
    user = User()
    user.username = "Tom"
    user.save()
    return "增加成功"


@blue.route('/dropuser/')
def dropuser():
    models.drop_all()
    return "删除成功"
